<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>
JS极简练习
</title>
<style>
  li {color: orange;}
  .js li {color: purple;}
</style>
<script>
  function write_list(a, order=false){
    tag = order ? 'ol' : 'ul'
  
    document.write('<'+tag+'>')
    for (var j=0; j<a.length; j++){
      document.write('<li>'+a[j]+'</li>')
    }
    document.write('</'+tag+'>')
  }
  
  var a = ['HTML', 'CSS', "JavaScript"]
  write_list(a)
</script>
</head>
<body></body>
<div>Hello world</div>
<div class='js'>
<script>
  var a = ["盒子模型", '浮动', '定位', "动画", "排版"]
  write_list(a, order=true)
</script>
</div>
<div>你好世界</div>
</html>
